<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
    
</head>
<body>
    <div id="app">
        <p>{{show}}</p>
        <!-- v-show指令:(display:none) -->
        <div v-show="show">出现了</div>
        <!-- v-if指令隐藏 -->
        <div v-if="show">又出现了</div>
        <div v-else>else出现</div>
        <button @click="show=!show">显示或隐藏</button>
        
        <ul>
            <li v-for="item in students" :key="item.id">姓名:{{item.name}},年龄:{{item.age}}</li>
        </ul>
        <button @click="changeStu">修改学生</button>
        <button @click="addStu">添加学生</button>
        <p>当前学生共{{stuCount}}名</p>
    </div>
    <script src="demo2.js"></script>
</body>
</html>